package main

import "fmt"

type Test struct {
	G *Global
}

type Global struct {
	Name string
}

func (t Test) handle() {
	t.G = &Global{Name: "111"}
	//t.G.Name = "haha"
	fmt.Printf("%p\n", t.G)  // 0xc000010200
}

func main() {
	g := &Global{
		Name: "aaaaaa",
	}
	fmt.Printf("%p\n", g)  // 0xc000010200
	fmt.Println(g.Name)

	t := Test{
		G: g,
	}
	t.handle()
	fmt.Println(g.Name)
}